1 00:00:00,800 --> 00:00:04,930 All right, So let's start scripting our eruption on our lava. 2 00:00:04,940 --> 00:00:08,780 So let's go to lava and then the lava pool. 3 00:00:08,780 --> 00:00:10,510 Is that part right in here? 4 00:00:10,520 --> 00:00:12,140 I'm going to duplicate it. 5 00:00:12,140 --> 00:00:17,570 I'm going to take control D with collisions off so that it duplicates in place. 6 00:00:17,570 --> 00:00:23,450 The reason I'm doing this is because I'm going to have the flow drain down and I want to keep the pool 7 00:00:23,450 --> 00:00:24,110 there. 8 00:00:24,170 --> 00:00:24,540 Right? 9 00:00:24,560 --> 00:00:31,370 So I'm going to get rid of the sound on the second Liverpool so we don't need it. 10 00:00:31,970 --> 00:00:35,960 And then I'm going to call the second lava pool lava flow. 11 00:00:38,150 --> 00:00:40,130 I'll make a capital lava flow. 12 00:00:40,550 --> 00:00:41,330 There we go. 13 00:00:41,330 --> 00:00:43,820 So one's going to move, one is going to stay still. 14 00:00:43,850 --> 00:00:45,380 I'm going to go to Lava. 15 00:00:46,250 --> 00:00:46,790 Open that. 16 00:00:46,910 --> 00:00:49,280 Hit that plus sign out a script. 17 00:00:49,310 --> 00:00:51,210 I'm going to call this abrupt. 18 00:00:51,230 --> 00:00:52,940 Maybe I'll call this eruption. 19 00:00:53,150 --> 00:00:53,870 There we go. 20 00:00:55,010 --> 00:00:57,950 All right, Now, I got to get a reference to my lava flow. 21 00:00:57,980 --> 00:00:59,120 So local. 22 00:00:59,630 --> 00:01:00,930 I'll call it lava. 23 00:01:00,950 --> 00:01:02,960 Script Dot Parent. 24 00:01:02,990 --> 00:01:04,970 Oh, and then we have to go down one. 25 00:01:05,090 --> 00:01:06,930 Let's see. 26 00:01:06,950 --> 00:01:08,420 Script dot, parent. 27 00:01:08,420 --> 00:01:11,030 And then we'll have lava flow. 28 00:01:11,810 --> 00:01:16,440 I need a function, a local function, a call that erupt. 29 00:01:17,840 --> 00:01:19,180 And then we're going to do a for loop. 30 00:01:19,190 --> 00:01:24,440 We could do this twinning, and I'm going to introduce tweeting in more detail later, but we're going 31 00:01:24,440 --> 00:01:25,220 to use a for loop. 32 00:01:25,220 --> 00:01:36,200 But this it'll work fine for I equals one to let's say we'll go 80 and steps of one do let's increase 33 00:01:36,200 --> 00:01:37,910 the size of our lava flow. 34 00:01:37,910 --> 00:01:49,190 So let's say lava size equals lava dot size plus what we want to add to it on each iteration of the 35 00:01:49,190 --> 00:01:51,950 loop, I'm going to do vector three new. 36 00:01:53,000 --> 00:01:54,890 The height is the ex. 37 00:01:54,890 --> 00:01:57,410 Remember we rotated the cylinder. 38 00:01:57,410 --> 00:01:59,510 So that's a little bit weird, right? 39 00:01:59,510 --> 00:02:01,070 So this is the height I'm going to make it. 40 00:02:01,070 --> 00:02:10,010 0.03 is not going to increase much every loop iteration, but I am going to increase the X and the Z, 41 00:02:10,610 --> 00:02:10,970 right? 42 00:02:10,970 --> 00:02:16,550 It's actually the Y and the Z on the part, but X in the Z in the world space and I just played around 43 00:02:16,550 --> 00:02:18,140 with it until I got that right. 44 00:02:18,140 --> 00:02:18,470 Right. 45 00:02:18,500 --> 00:02:22,100 So don't worry if you're like, Oh my gosh, how am I supposed to know that, right? 46 00:02:22,100 --> 00:02:23,660 Just play with it and you'll get it. 47 00:02:23,660 --> 00:02:28,370 So I'll do a weight point one second in between each loop iteration. 48 00:02:28,370 --> 00:02:33,740 This is going to expand my lava out on the X and Z much faster than the height. 49 00:02:33,740 --> 00:02:37,130 So let's do a way to get in the world to see it. 50 00:02:37,160 --> 00:02:42,670 We'll do like 8 seconds and then we'll do an abrupt Let's try. 51 00:02:48,670 --> 00:02:50,420 And we'll look for errors down here. 52 00:02:50,440 --> 00:02:51,250 Output. 53 00:02:53,590 --> 00:02:54,330 There we go. 54 00:02:54,340 --> 00:02:55,630 It's expanding. 55 00:02:56,470 --> 00:02:57,540 It's looking good. 56 00:02:57,550 --> 00:02:59,290 It's slowly increasing. 57 00:03:01,930 --> 00:03:03,290 Yeah, not bad. 58 00:03:03,310 --> 00:03:04,420 It's going to stay there. 59 00:03:04,420 --> 00:03:06,070 We have to drain it off now. 60 00:03:06,070 --> 00:03:08,170 So in the next video, I'll do the drain.